import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Index from '@/components/Index'

Vue.use(Router)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/index',
    name: 'Index',
    meta: {
      //表示进入到该页面需要登录
      requireAuth: true
    },
    component: Index
  }
];

const router = new Router({
  mode: 'history',
  routes
});

export default router;


